<script>
	// #ifndef H5
	import { weixin } from '@/api/'
	// #endif

	export default {
		onLaunch: function() {
			// #ifndef H5
			uni.login({
				success: async ({ code }) => { //({code})
					// 发送 res.code 到后台换取 openId, sessionKey, unionId
					let { status, data } = await weixin.auth_login({ code });
					if (status) {
						uni.setStorageSync('token', data.token)
					}
				}
			})
			// #endif
			// 登录

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";

	::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}
</style>